package com.amos.knife4j.controller;

import com.amos.knife4j.DemoEntity;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "首页模块")
@ApiSupport(author = "amos", order = 284)
@RestController
public class IndexController {


    @ApiImplicitParams({
            @ApiImplicitParam(name = "mobile", value = "手机号", required = true, paramType = "form"),
            @ApiImplicitParam(name = "password", value = "密码", required = true, paramType = "form"),
            @ApiImplicitParam(name = "age", value = "年龄", required = true, paramType = "form", dataType = "Integer")
    })

    @ApiOperation(value = "测试接口")
    @GetMapping("/test/hello")
    public ResponseEntity<DemoEntity> sayHi(@RequestParam(value = "name") String name) {
        return ResponseEntity.ok(new DemoEntity());
    }
}